<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
            "http://www.w3.org/TR/REC-html40/loose.dtd">
<HTML>
<HEAD>



<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<META name="GENERATOR" content="hevea 1.08">
<LINK rel="stylesheet" type="text/css" href="embroot.css">
<TITLE>
Passing Control and Data to ECLiPSe from C++
</TITLE>
</HEAD>
<BODY >
<A HREF="embroot071.html"><IMG SRC ="previous_motif.gif" ALT="Previous"></A>
<A HREF="embroot065.html"><IMG SRC ="contents_motif.gif" ALT="Up"></A>
<HR>

<H2 CLASS="section"><A NAME="htoc137">B.7</A>&nbsp;&nbsp;Passing Control and Data to ECL<SUP><I>i</I></SUP>PS<SUP><I>e</I></SUP> from C++</H2>
These are the functions needed to embed ECL<SUP><I>i</I></SUP>PS<SUP><I>e</I></SUP> into C++ code.
<DL CLASS="description" COMPACT=compact><DT CLASS="dt-description">
<B>void post_goal(const EC_word)</B><DD CLASS="dd-description"><BR>
<DT CLASS="dt-description"><B>void post_goal(const char *)</B><DD CLASS="dd-description"><BR>
	post a goal (constraint) that will be executed when ECL<SUP><I>i</I></SUP>PS<SUP><I>e</I></SUP>	is resumed.<BR>
<BR>
<DT CLASS="dt-description"><B>int EC_resume(EC_word FromC, EC_ref&amp; ToC)</B><DD CLASS="dd-description"><BR>
<DT CLASS="dt-description"><B>int EC_resume(EC_word FromC)</B><DD CLASS="dd-description"><BR>
<DT CLASS="dt-description"><B>int EC_resume()</B><DD CLASS="dd-description"><BR>
	resume execution of the ECL<SUP><I>i</I></SUP>PS<SUP><I>e</I></SUP> engine: All posted goals will
	be executed. The return value will be EC_succeed if the goals succeed
	(in this case the ToC argument returns a cut value that can be
	used to discard alternative solutions). EC_fail is returned if the
	goals fail, and EC_yield if control was yielded because of a
	yield/2 predicate call in the ECL<SUP><I>i</I></SUP>PS<SUP><I>e</I></SUP> code (in this case, ToC
	contains the data passed by the first argument of yield/2).
	If a writable queue stream with yield-option
	(see <A HREF="../bips/kernel/iostream/open-4.html"><B>open/4</B></A><A NAME="@default389"></A>)
	was flushed, the return value is PFLUSHIO and ToC contains the
	associated stream number.
	If there was an attempt to read from an empty queue stream with
	yield-option, the return value is PWAITIO and ToC contains the
	associated stream number.
	Moreover, if the previous EC_resume yielded
	due to a yield/2 predicate call, The term FromC is passed
	as input into the second argument of yield/2 on resuming.<BR>
<BR>
<DT CLASS="dt-description"><B>void EC_ref::cut_to()</B><DD CLASS="dd-description"><BR>
	Should be applied to the ToC cut return value of an EC_resume().
	Cut all choicepoints created by the batch of goals whose execution
	succeeded.<BR>
<BR>
<DT CLASS="dt-description"><B>int post_event(EC_word Name)</B><DD CLASS="dd-description"><BR>
	Post an event to the ECL<SUP><I>i</I></SUP>PS<SUP><I>e</I></SUP> engine. This will lead to the
	execution of the corresponding event handler once the ECL<SUP><I>i</I></SUP>PS<SUP><I>e</I></SUP>	execution is resumed. See also <A HREF="../bips/kernel/event/event-1.html"><B>event/1</B></A><A NAME="@default390"></A> and the User Manual
	chapter on event handling for more information. Name should be 
	an ECL<SUP><I>i</I></SUP>PS<SUP><I>e</I></SUP> atom.
</DL>
<HR>
<A HREF="embroot071.html"><IMG SRC ="previous_motif.gif" ALT="Previous"></A>
<A HREF="embroot065.html"><IMG SRC ="contents_motif.gif" ALT="Up"></A>
</BODY>
</HTML>
